/*****************************************************************************
* crc.h: Copyright 2021 (c) renyucjs
* Desc:           
* 
* Author: Kimson (renyucjs@gmail.com)
* Date: 2021-10-04
* Notes: 
* 
* ---------------------------------------------------------------------------
* LastEditors: 
* LastEditTime: 
*****************************************************************************/
#ifndef CRC_H_
#define CRC_H_

/*------------------------------- Includes ----------------------------------*/
#include <stddef.h>
#include <stdint.h>
/*----------------------------- Global Defines ------------------------------*/
#define uint_len size_t
/*----------------------------- Global Typedefs -----------------------------*/

/*----------------------------- External Variables --------------------------*/

/*------------------------ Global Function Prototypes -----------------------*/
extern uint8_t crc4_itu(uint8_t *data, uint_len length);
extern uint8_t crc4_itu_lk(uint8_t *data, uint_len length);
extern uint8_t crc5_epc(uint8_t *data, uint_len length);
extern uint8_t crc5_itu(uint8_t *data, uint_len length);
extern uint8_t crc5_usb(uint8_t *data, uint_len length);
extern uint8_t crc6_itu(uint8_t *data, uint_len length);
extern uint8_t crc7_mmc(uint8_t *data, uint_len length);
extern uint8_t crc8(uint8_t *data, uint_len length);
extern uint8_t crc8_itu(uint8_t *data, uint_len length);
extern uint8_t crc8_rohc(uint8_t *data, uint_len length);
extern uint8_t crc8_maxim(uint8_t *data, uint_len length);//DS18B20
extern uint16_t crc16_ibm(uint8_t *data, uint_len length);
extern uint16_t crc16_maxim(uint8_t *data, uint_len length);
extern uint16_t crc16_usb(uint8_t *data, uint_len length);
extern uint16_t crc16_modbus(uint8_t *data, uint_len length);
extern uint16_t crc16_ccitt(uint8_t *data, uint_len length);
extern uint16_t crc16_ccitt_false(uint8_t *data, uint_len length);
extern uint16_t crc16_x25(uint8_t *data, uint_len length);
extern uint16_t crc16_xmodem(uint8_t *data, uint_len length);
extern uint16_t crc16_dnp(uint8_t *data, uint_len length);
extern uint32_t crc32(uint8_t *data, uint_len length);
extern uint32_t crc32_mpeg_2(uint8_t *data, uint_len length);

#endif//CRC_H_
